<script setup lang="ts">
import axios from 'axios';
import { onMounted, ref } from 'vue';


// 这些数据其实在组件创建阶段就已经完成
const name = ref('ikun')

const getData = async () => {
  const res = await axios.get('http://hmajax.itheima.net/api/news')
  console.log(res.data.data)
}
// getData()
console.log(Date.now())

// 创建完毕之后再执行
onMounted(() => {
  getData()
  console.log(Date.now())
})

</script>

<template>
</template>